from typing import Optional, List
from langchain.text_splitter import CharacterTextSplitter

text_split = CharacterTextSplitter(
    separator=' ',  # 空格分割,但是空格也属于字符串
    chunk_size=5,
    chunk_overlap=0
)
a = text_split.split_text('a b c d e f')
print(a)
texts = text_split.create_documents(['a b c d e f', 'e f g h'])
print(texts)
